package com.lzh.o2o.dto;
/** 
* @author  haohao: 
* @date 创建时间：2018年9月13日 下午7:14:46 
* @version 1.0 
* @parameter 
* @since  
* @return  封装json对象，所有返回结果都使用它，也可以直接返回Map
*/
public class Result<T> {

	private boolean success;//是否成功标志
	
	private T data;//成功时返回的数据
	
	private String errorMsg;//错误信息
	
	private int errorCode;//错误编码
	
	public Result(){
		
	}
	//成功时的构造器
	public Result(boolean success,T data){
		this.success = success;
		this.data = data;
	}
	
	//错误时的构造器
	public Result(boolean success,int errorCode,String errorMsg){
		this.success = success;
		this.errorCode = errorCode;
		this.errorMsg = errorMsg;
	}
	
	public T getData() {
		return data;
	}
	public void setData(T data) {
		this.data = data;
	}
	public String getErrorMsg() {
		return errorMsg;
	}
	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}
	public int getErrorCode() {
		return errorCode;
	}
	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}
	public boolean isSuccess(){
		return success;
	}
	
	public void setSuccess(boolean success){
		this.success = success;
	}
}
